package cz.vutbr.fit.xzemko01.tfmcbs.diagram.part;

import java.util.Collection;
import java.util.Collections;
import java.util.Iterator;
import java.util.LinkedList;
import java.util.List;
import java.util.Map;

import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EStructuralFeature;
import org.eclipse.emf.ecore.util.EcoreUtil;
import org.eclipse.gmf.runtime.notation.View;
import org.eclipse.gmf.tooling.runtime.update.DiagramUpdater;

import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.ArtifactEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.CompositeComponent2EditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.CompositeComponentCompositeComponentCompartment2EditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.CompositeComponentCompositeComponentCompartmentEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.CompositeComponentEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.DelegateEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.DependencyEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.GeneralizationEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.Interface2EditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.InterfaceEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.ManifestationEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.ModelEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.ProvidingPortEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.RealizationEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.RequiringPortEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.SimpleComponent2EditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.SimpleComponentEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.edit.parts.UsageEditPart;
import cz.vutbr.fit.xzemko01.tfmcbs.diagram.providers.ComponentBasedSystemElementTypes;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Artifact;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Component;
import cz.vutbr.fit.xzemko01.tfmcbs.model.CompositeComponent;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Container;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Delegate;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Dependency;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Element;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Entity;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Generalization;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Interface;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Manifestation;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Model;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Port;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Provider;
import cz.vutbr.fit.xzemko01.tfmcbs.model.ProvidingPort;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Realization;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Requier;
import cz.vutbr.fit.xzemko01.tfmcbs.model.RequiringPort;
import cz.vutbr.fit.xzemko01.tfmcbs.model.SimpleComponent;
import cz.vutbr.fit.xzemko01.tfmcbs.model.Usage;
import cz.vutbr.fit.xzemko01.tfmcbs.model.meta.TfmcbsPackage;

/**
 * @generated
 */
public class ComponentBasedSystemDiagramUpdater {

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getSemanticChildren(
			View view) {
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case ModelEditPart.VISUAL_ID:
			return getModel_1000SemanticChildren(view);
		case CompositeComponentEditPart.VISUAL_ID:
			return getCompositeComponent_2002SemanticChildren(view);
		case CompositeComponent2EditPart.VISUAL_ID:
			return getCompositeComponent_3002SemanticChildren(view);
		case CompositeComponentCompositeComponentCompartmentEditPart.VISUAL_ID:
			return getCompositeComponentCompositeComponentCompartment_7001SemanticChildren(view);
		case CompositeComponentCompositeComponentCompartment2EditPart.VISUAL_ID:
			return getCompositeComponentCompositeComponentCompartment_7002SemanticChildren(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getModel_1000SemanticChildren(
			View view) {
		if (!view.isSetElement()) {
			return Collections.emptyList();
		}
		Model modelElement = (Model) view.getElement();
		LinkedList<ComponentBasedSystemNodeDescriptor> result = new LinkedList<ComponentBasedSystemNodeDescriptor>();
		for (Iterator<?> it = modelElement.getElements().iterator(); it
				.hasNext();) {
			Element childElement = (Element) it.next();
			int visualID = ComponentBasedSystemVisualIDRegistry
					.getNodeVisualID(view, childElement);
			if (visualID == SimpleComponentEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == CompositeComponentEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == ArtifactEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == InterfaceEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getCompositeComponent_2002SemanticChildren(
			View view) {
		if (!view.isSetElement()) {
			return Collections.emptyList();
		}
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemNodeDescriptor> result = new LinkedList<ComponentBasedSystemNodeDescriptor>();
		for (Iterator<?> it = modelElement.getPorts().iterator(); it.hasNext();) {
			Port childElement = (Port) it.next();
			int visualID = ComponentBasedSystemVisualIDRegistry
					.getNodeVisualID(view, childElement);
			if (visualID == ProvidingPortEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == RequiringPortEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getCompositeComponent_3002SemanticChildren(
			View view) {
		if (!view.isSetElement()) {
			return Collections.emptyList();
		}
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemNodeDescriptor> result = new LinkedList<ComponentBasedSystemNodeDescriptor>();
		for (Iterator<?> it = modelElement.getPorts().iterator(); it.hasNext();) {
			Port childElement = (Port) it.next();
			int visualID = ComponentBasedSystemVisualIDRegistry
					.getNodeVisualID(view, childElement);
			if (visualID == ProvidingPortEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == RequiringPortEditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getCompositeComponentCompositeComponentCompartment_7001SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		CompositeComponent modelElement = (CompositeComponent) containerView
				.getElement();
		LinkedList<ComponentBasedSystemNodeDescriptor> result = new LinkedList<ComponentBasedSystemNodeDescriptor>();
		for (Iterator<?> it = modelElement.getElements().iterator(); it
				.hasNext();) {
			Element childElement = (Element) it.next();
			int visualID = ComponentBasedSystemVisualIDRegistry
					.getNodeVisualID(view, childElement);
			if (visualID == SimpleComponent2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == CompositeComponent2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == Interface2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemNodeDescriptor> getCompositeComponentCompositeComponentCompartment_7002SemanticChildren(
			View view) {
		if (false == view.eContainer() instanceof View) {
			return Collections.emptyList();
		}
		View containerView = (View) view.eContainer();
		if (!containerView.isSetElement()) {
			return Collections.emptyList();
		}
		CompositeComponent modelElement = (CompositeComponent) containerView
				.getElement();
		LinkedList<ComponentBasedSystemNodeDescriptor> result = new LinkedList<ComponentBasedSystemNodeDescriptor>();
		for (Iterator<?> it = modelElement.getElements().iterator(); it
				.hasNext();) {
			Element childElement = (Element) it.next();
			int visualID = ComponentBasedSystemVisualIDRegistry
					.getNodeVisualID(view, childElement);
			if (visualID == SimpleComponent2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == CompositeComponent2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
			if (visualID == Interface2EditPart.VISUAL_ID) {
				result.add(new ComponentBasedSystemNodeDescriptor(childElement,
						visualID));
				continue;
			}
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getContainedLinks(
			View view) {
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case ModelEditPart.VISUAL_ID:
			return getModel_1000ContainedLinks(view);
		case SimpleComponentEditPart.VISUAL_ID:
			return getSimpleComponent_2001ContainedLinks(view);
		case CompositeComponentEditPart.VISUAL_ID:
			return getCompositeComponent_2002ContainedLinks(view);
		case ArtifactEditPart.VISUAL_ID:
			return getArtifact_2003ContainedLinks(view);
		case InterfaceEditPart.VISUAL_ID:
			return getInterface_2004ContainedLinks(view);
		case SimpleComponent2EditPart.VISUAL_ID:
			return getSimpleComponent_3001ContainedLinks(view);
		case CompositeComponent2EditPart.VISUAL_ID:
			return getCompositeComponent_3002ContainedLinks(view);
		case Interface2EditPart.VISUAL_ID:
			return getInterface_3003ContainedLinks(view);
		case ProvidingPortEditPart.VISUAL_ID:
			return getProvidingPort_3004ContainedLinks(view);
		case RequiringPortEditPart.VISUAL_ID:
			return getRequiringPort_3005ContainedLinks(view);
		case DependencyEditPart.VISUAL_ID:
			return getDependency_4001ContainedLinks(view);
		case ManifestationEditPart.VISUAL_ID:
			return getManifestation_4002ContainedLinks(view);
		case RealizationEditPart.VISUAL_ID:
			return getRealization_4003ContainedLinks(view);
		case UsageEditPart.VISUAL_ID:
			return getUsage_4004ContainedLinks(view);
		case GeneralizationEditPart.VISUAL_ID:
			return getGeneralization_4005ContainedLinks(view);
		case DelegateEditPart.VISUAL_ID:
			return getDelegate_4006ContainedLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getIncomingLinks(
			View view) {
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case SimpleComponentEditPart.VISUAL_ID:
			return getSimpleComponent_2001IncomingLinks(view);
		case CompositeComponentEditPart.VISUAL_ID:
			return getCompositeComponent_2002IncomingLinks(view);
		case ArtifactEditPart.VISUAL_ID:
			return getArtifact_2003IncomingLinks(view);
		case InterfaceEditPart.VISUAL_ID:
			return getInterface_2004IncomingLinks(view);
		case SimpleComponent2EditPart.VISUAL_ID:
			return getSimpleComponent_3001IncomingLinks(view);
		case CompositeComponent2EditPart.VISUAL_ID:
			return getCompositeComponent_3002IncomingLinks(view);
		case Interface2EditPart.VISUAL_ID:
			return getInterface_3003IncomingLinks(view);
		case ProvidingPortEditPart.VISUAL_ID:
			return getProvidingPort_3004IncomingLinks(view);
		case RequiringPortEditPart.VISUAL_ID:
			return getRequiringPort_3005IncomingLinks(view);
		case DependencyEditPart.VISUAL_ID:
			return getDependency_4001IncomingLinks(view);
		case ManifestationEditPart.VISUAL_ID:
			return getManifestation_4002IncomingLinks(view);
		case RealizationEditPart.VISUAL_ID:
			return getRealization_4003IncomingLinks(view);
		case UsageEditPart.VISUAL_ID:
			return getUsage_4004IncomingLinks(view);
		case GeneralizationEditPart.VISUAL_ID:
			return getGeneralization_4005IncomingLinks(view);
		case DelegateEditPart.VISUAL_ID:
			return getDelegate_4006IncomingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getOutgoingLinks(
			View view) {
		switch (ComponentBasedSystemVisualIDRegistry.getVisualID(view)) {
		case SimpleComponentEditPart.VISUAL_ID:
			return getSimpleComponent_2001OutgoingLinks(view);
		case CompositeComponentEditPart.VISUAL_ID:
			return getCompositeComponent_2002OutgoingLinks(view);
		case ArtifactEditPart.VISUAL_ID:
			return getArtifact_2003OutgoingLinks(view);
		case InterfaceEditPart.VISUAL_ID:
			return getInterface_2004OutgoingLinks(view);
		case SimpleComponent2EditPart.VISUAL_ID:
			return getSimpleComponent_3001OutgoingLinks(view);
		case CompositeComponent2EditPart.VISUAL_ID:
			return getCompositeComponent_3002OutgoingLinks(view);
		case Interface2EditPart.VISUAL_ID:
			return getInterface_3003OutgoingLinks(view);
		case ProvidingPortEditPart.VISUAL_ID:
			return getProvidingPort_3004OutgoingLinks(view);
		case RequiringPortEditPart.VISUAL_ID:
			return getRequiringPort_3005OutgoingLinks(view);
		case DependencyEditPart.VISUAL_ID:
			return getDependency_4001OutgoingLinks(view);
		case ManifestationEditPart.VISUAL_ID:
			return getManifestation_4002OutgoingLinks(view);
		case RealizationEditPart.VISUAL_ID:
			return getRealization_4003OutgoingLinks(view);
		case UsageEditPart.VISUAL_ID:
			return getUsage_4004OutgoingLinks(view);
		case GeneralizationEditPart.VISUAL_ID:
			return getGeneralization_4005OutgoingLinks(view);
		case DelegateEditPart.VISUAL_ID:
			return getDelegate_4006OutgoingLinks(view);
		}
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getModel_1000ContainedLinks(
			View view) {
		Model modelElement = (Model) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getContainedTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Generalization_4005(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Delegate_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_2001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_2002ContainedLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getContainedTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Generalization_4005(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Delegate_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getArtifact_2003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_2004ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_3001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_3002ContainedLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getContainedTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Manifestation_4002(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Generalization_4005(modelElement));
		result.addAll(getContainedTypeModelFacetLinks_Delegate_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_3003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getProvidingPort_3004ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRequiringPort_3005ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDependency_4001ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getManifestation_4002ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRealization_4003ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getUsage_4004ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getGeneralization_4005ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDelegate_4006ContainedLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_2001IncomingLinks(
			View view) {
		SimpleComponent modelElement = (SimpleComponent) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_2002IncomingLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getArtifact_2003IncomingLinks(
			View view) {
		Artifact modelElement = (Artifact) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_2004IncomingLinks(
			View view) {
		Interface modelElement = (Interface) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Realization_4003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Usage_4004(modelElement,
				crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Delegate_4006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_3001IncomingLinks(
			View view) {
		SimpleComponent modelElement = (SimpleComponent) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_3002IncomingLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Manifestation_4002(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_3003IncomingLinks(
			View view) {
		Interface modelElement = (Interface) view.getElement();
		Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences = EcoreUtil.CrossReferencer
				.find(view.eResource().getResourceSet().getResources());
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getIncomingTypeModelFacetLinks_Dependency_4001(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Realization_4003(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Usage_4004(modelElement,
				crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Generalization_4005(
				modelElement, crossReferences));
		result.addAll(getIncomingTypeModelFacetLinks_Delegate_4006(
				modelElement, crossReferences));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getProvidingPort_3004IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRequiringPort_3005IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDependency_4001IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getManifestation_4002IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRealization_4003IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getUsage_4004IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getGeneralization_4005IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDelegate_4006IncomingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_2001OutgoingLinks(
			View view) {
		SimpleComponent modelElement = (SimpleComponent) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_2002OutgoingLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getArtifact_2003OutgoingLinks(
			View view) {
		Artifact modelElement = (Artifact) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Manifestation_4002(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_2004OutgoingLinks(
			View view) {
		Interface modelElement = (Interface) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getSimpleComponent_3001OutgoingLinks(
			View view) {
		SimpleComponent modelElement = (SimpleComponent) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getCompositeComponent_3002OutgoingLinks(
			View view) {
		CompositeComponent modelElement = (CompositeComponent) view
				.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getInterface_3003OutgoingLinks(
			View view) {
		Interface modelElement = (Interface) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Dependency_4001(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Generalization_4005(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getProvidingPort_3004OutgoingLinks(
			View view) {
		ProvidingPort modelElement = (ProvidingPort) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Realization_4003(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Delegate_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRequiringPort_3005OutgoingLinks(
			View view) {
		RequiringPort modelElement = (RequiringPort) view.getElement();
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		result.addAll(getOutgoingTypeModelFacetLinks_Usage_4004(modelElement));
		result.addAll(getOutgoingTypeModelFacetLinks_Delegate_4006(modelElement));
		return result;
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDependency_4001OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getManifestation_4002OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getRealization_4003OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getUsage_4004OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getGeneralization_4005OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	public static List<ComponentBasedSystemLinkDescriptor> getDelegate_4006OutgoingLinks(
			View view) {
		return Collections.emptyList();
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Dependency_4001(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Dependency) {
				continue;
			}
			Dependency link = (Dependency) linkObject;
			if (DependencyEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity dst = link.getTo();
			Entity src = link.getFrom();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Dependency_4001,
					DependencyEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Manifestation_4002(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Manifestation) {
				continue;
			}
			Manifestation link = (Manifestation) linkObject;
			if (ManifestationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Component dst = link.getComponent();
			Artifact src = link.getArtifact();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Manifestation_4002,
					ManifestationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Realization_4003(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Realization) {
				continue;
			}
			Realization link = (Realization) linkObject;
			if (RealizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Provider src = link.getProvider();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Realization_4003,
					RealizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Usage_4004(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Usage) {
				continue;
			}
			Usage link = (Usage) linkObject;
			if (UsageEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Requier src = link.getRequier();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Usage_4004,
					UsageEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Generalization_4005(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Generalization) {
				continue;
			}
			Generalization link = (Generalization) linkObject;
			if (GeneralizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity dst = link.getParent();
			Entity src = link.getChild();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Generalization_4005,
					GeneralizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getContainedTypeModelFacetLinks_Delegate_4006(
			Container container) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Delegate) {
				continue;
			}
			Delegate link = (Delegate) linkObject;
			if (DelegateEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Port src = link.getPort();
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Delegate_4006,
					DelegateEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Dependency_4001(
			Entity target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getDependency_To()
					|| false == setting.getEObject() instanceof Dependency) {
				continue;
			}
			Dependency link = (Dependency) setting.getEObject();
			if (DependencyEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity src = link.getFrom();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Dependency_4001,
					DependencyEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Manifestation_4002(
			Component target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getManifestation_Component()
					|| false == setting.getEObject() instanceof Manifestation) {
				continue;
			}
			Manifestation link = (Manifestation) setting.getEObject();
			if (ManifestationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Artifact src = link.getArtifact();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Manifestation_4002,
					ManifestationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Realization_4003(
			Interface target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getRealization_Interface()
					|| false == setting.getEObject() instanceof Realization) {
				continue;
			}
			Realization link = (Realization) setting.getEObject();
			if (RealizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Provider src = link.getProvider();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Realization_4003,
					RealizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Usage_4004(
			Interface target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getUsage_Interface()
					|| false == setting.getEObject() instanceof Usage) {
				continue;
			}
			Usage link = (Usage) setting.getEObject();
			if (UsageEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Requier src = link.getRequier();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Usage_4004,
					UsageEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Generalization_4005(
			Entity target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getGeneralization_Parent()
					|| false == setting.getEObject() instanceof Generalization) {
				continue;
			}
			Generalization link = (Generalization) setting.getEObject();
			if (GeneralizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity src = link.getChild();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Generalization_4005,
					GeneralizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getIncomingTypeModelFacetLinks_Delegate_4006(
			Interface target,
			Map<EObject, Collection<EStructuralFeature.Setting>> crossReferences) {
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		Collection<EStructuralFeature.Setting> settings = crossReferences
				.get(target);
		for (EStructuralFeature.Setting setting : settings) {
			if (setting.getEStructuralFeature() != TfmcbsPackage.eINSTANCE
					.getDelegate_Interface()
					|| false == setting.getEObject() instanceof Delegate) {
				continue;
			}
			Delegate link = (Delegate) setting.getEObject();
			if (DelegateEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Port src = link.getPort();
			result.add(new ComponentBasedSystemLinkDescriptor(src, target,
					link, ComponentBasedSystemElementTypes.Delegate_4006,
					DelegateEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Dependency_4001(
			Entity source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Dependency) {
				continue;
			}
			Dependency link = (Dependency) linkObject;
			if (DependencyEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity dst = link.getTo();
			Entity src = link.getFrom();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Dependency_4001,
					DependencyEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Manifestation_4002(
			Artifact source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Manifestation) {
				continue;
			}
			Manifestation link = (Manifestation) linkObject;
			if (ManifestationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Component dst = link.getComponent();
			Artifact src = link.getArtifact();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Manifestation_4002,
					ManifestationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Realization_4003(
			Provider source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Realization) {
				continue;
			}
			Realization link = (Realization) linkObject;
			if (RealizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Provider src = link.getProvider();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Realization_4003,
					RealizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Usage_4004(
			Requier source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Usage) {
				continue;
			}
			Usage link = (Usage) linkObject;
			if (UsageEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Requier src = link.getRequier();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Usage_4004,
					UsageEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Generalization_4005(
			Entity source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Generalization) {
				continue;
			}
			Generalization link = (Generalization) linkObject;
			if (GeneralizationEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Entity dst = link.getParent();
			Entity src = link.getChild();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Generalization_4005,
					GeneralizationEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	private static Collection<ComponentBasedSystemLinkDescriptor> getOutgoingTypeModelFacetLinks_Delegate_4006(
			Port source) {
		Container container = null;
		// Find container element for the link.
		// Climb up by containment hierarchy starting from the source
		// and return the first element that is instance of the container class.
		for (EObject element = source; element != null && container == null; element = element
				.eContainer()) {
			if (element instanceof Container) {
				container = (Container) element;
			}
		}
		if (container == null) {
			return Collections.emptyList();
		}
		LinkedList<ComponentBasedSystemLinkDescriptor> result = new LinkedList<ComponentBasedSystemLinkDescriptor>();
		for (Iterator<?> links = container.getElements().iterator(); links
				.hasNext();) {
			EObject linkObject = (EObject) links.next();
			if (false == linkObject instanceof Delegate) {
				continue;
			}
			Delegate link = (Delegate) linkObject;
			if (DelegateEditPart.VISUAL_ID != ComponentBasedSystemVisualIDRegistry
					.getLinkWithClassVisualID(link)) {
				continue;
			}
			Interface dst = link.getInterface();
			Port src = link.getPort();
			if (src != source) {
				continue;
			}
			result.add(new ComponentBasedSystemLinkDescriptor(src, dst, link,
					ComponentBasedSystemElementTypes.Delegate_4006,
					DelegateEditPart.VISUAL_ID));
		}
		return result;
	}

	/**
	 * @generated
	 */
	public static final DiagramUpdater TYPED_INSTANCE = new DiagramUpdater() {
		/**
		 * @generated
		 */
		@Override
		public List<ComponentBasedSystemNodeDescriptor> getSemanticChildren(
				View view) {
			return ComponentBasedSystemDiagramUpdater.getSemanticChildren(view);
		}

		/**
		 * @generated
		 */
		@Override
		public List<ComponentBasedSystemLinkDescriptor> getContainedLinks(
				View view) {
			return ComponentBasedSystemDiagramUpdater.getContainedLinks(view);
		}

		/**
		 * @generated
		 */
		@Override
		public List<ComponentBasedSystemLinkDescriptor> getIncomingLinks(
				View view) {
			return ComponentBasedSystemDiagramUpdater.getIncomingLinks(view);
		}

		/**
		 * @generated
		 */
		@Override
		public List<ComponentBasedSystemLinkDescriptor> getOutgoingLinks(
				View view) {
			return ComponentBasedSystemDiagramUpdater.getOutgoingLinks(view);
		}
	};

}
